package com.prs.crm.dao.oa.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.oa.NewsCollectDao;
import com.prs.crm.domain.oa.NewsCollect;
import com.prs.crm.domain.oa.NewsCollectType;

public class NewsCollectDaoImpl extends BaseDaoImpl<NewsCollect> implements NewsCollectDao{

	@Override
	public List<NewsCollect> getCollectByType(NewsCollectType newsCollectType) {
		Criteria criteria = this.getSession().createCriteria(NewsCollect.class);
		criteria.add(Restrictions.eq("type", newsCollectType));
		List<NewsCollect> list = criteria.list();
		if(list.size()!=0){
			return list;
		}else{
			return null;
		}
	}

}
